<?xml version="1.0" encoding="UTF-8"?>
<!-- doctype nechyba ??? -->
<!--
    Document   : calendarXSL.xsl
    Created on : Nedeľa, 2011, október 23, 0:00
    Author     : nue
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:calendar="urn:x-szatmary:schemata:calendar.1.0" version="1.0">
    
    <xsl:output method="html" />

    <!-- TODO customize transformation rules 
         syntax recommendation http://www.w3.org/TR/xslt 
    -->
    <xsl:template match="/">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
                <title>calendarXSL.xsl</title>
            </head>
            <body>       
                <div id="all">

                    <div id="banner">
                    </div><!--banner--> 
                    <div id="navigation">

                        <ul>
                            <li>
                                <span class="pressed">Calendar 
                                    <xsl:value-of select="calendar:calendar/@owner"/>
                                </span>
                            </li> 
                            <!--<li><a href="CalendarFeri.xml" title="odkaz">Calendar Feri</a></li>-->
                        </ul>

                    </div><!--navigation--> 

                    <div id="up-menu">
                    </div><!--up-menu-->

                    <div id="torso">

                        <div id="left-menu">

<!-- news -->
                            <div class="part-left-menu">
                                <div class="header">
                                    <span class="pressed bannertext-left-menu">News</span>
                                </div> 
                            </div>

<!-- notes -->
                            <div class="part-left-menu">
                                <div class="header">
                                    <span class="pressed bannertext-left-menu">Notes</span>
                                </div>
                            </div>


                        </div><!--left-menu--> 

                        <div id="content">
                            <xsl:variable name="counter" select="1" as="xs:integer"/>
                            <h2>Calendar: 
                                <xsl:value-of select="calendar:calendar/@owner"/>
                            </h2>
                            <table cellpadding="10" cellspacing="18">
                                <xsl:for-each select="calendar:calendar/calendar:event">
                                    <tr>
                                        <td>
                                            <!-- inkrement cisla -->
                                                <xsl:variable name="count">
                                                    <xsl:number/>
                                                </xsl:variable>
                                             
                                            <span class="date-text" onclick="zobrazSkryj('sp{$count}')" >
                                                <xsl:value-of select="calendar:when/calendar:day"/>.
                                                <xsl:value-of select="calendar:when/calendar:month"/>.
                                                <xsl:value-of select="calendar:when/calendar:year"/>
                                            </span>
                                            
                                            
                                            <br />
                                            <br />
                                            <div id="sp{$count}" class="skryvany">
                                                <span class="what-text">
                                                    <xsl:value-of select="calendar:what"/>
                                                </span>
                                                <br />
                                                <b>Where: </b>
                                                <xsl:value-of select="calendar:where/calendar:place"/>,
                                                <xsl:value-of select="calendar:where/calendar:town"/>,
                                                <xsl:value-of select="calendar:where/calendar:nation"/>
                                                <br />
                    
                                                <b>When: </b>
                                                <xsl:value-of select="calendar:when/calendar:hours"/>:<xsl:value-of select="calendar:when/calendar:minutes"/>
                                                <br />
                                            
                                                <b>Organisator: </b>
                                                <xsl:value-of select="calendar:organisator/calendar:name"/>
                                                <xsl:text> </xsl:text><!-- medzera -->
                                                <xsl:value-of select="calendar:organisator/calendar:surname"/>
                                                <br />
                    
                                                <b>Aditional: </b>
                                                <xsl:for-each select="calendar:aditional/calendar:info">
                                                    <xsl:value-of select="."/>,
                                                </xsl:for-each>
                                
                                            </div>
                                        </td>
                                    </tr>
                                </xsl:for-each>
                            </table>
    
                        </div><!--content-->

                    </div><!--torso-->

                    <div id="footer">
                     WEBOVÉ TECHNOLÓGIE: Zadanie číslo 1 ,
                     Autor: Peter Szatmary, ŠKolský rok: 2011/2012
                    </div><!--footer-->
                </div><!--all-->
                <script> 
function zobrazSkryj(idecko){
el=document.getElementById(idecko).style; 
el.display=(el.display == 'block')?'none':'block';
}


var zobrazena = "prvni"; // pomocna promenna, na zacatku nastavena na jmeno zobrazene polozky
function zobraz(polozka){
if (document.getElementById){
document.getElementById(zobrazena).style.display = "none"; // skryje předchozí polozku
document.getElementById(polozka).style.display = "block"; // zobrazi se nakliknuta polozka
zobrazena = polozka; // aktualne zobrazena polozka se ulozi do globalni promenne, aby se pozdeji dala skryt
return false; // odkaz neproklikne na href
}
else {
if(document.stylesheets) document.stylesheets["zalozky"].disabled = true; // v nekterych browserech (IE 4) vypne styl nezobrazovani, aby se polozky alespon zobrazily
return true; // odkazy budou proklikavat na href
} 
}
                </script>
            </body>
        </html>
    </xsl:template>

</xsl:stylesheet>
